package com.itlong.cloud.project.sdk;

import com.itlong.cloud.POJO.PO.UnitInfoPO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      SDK楼单元服务层暴露接口
 * </desc>
 *
 * @createDate 2017/11/8
 */
@FeignClient(name = "project-service")
public interface ISDKServerOldUnitServiceClient {

    /**
     * <desc>
     *      根据参数字段查询unit_info信息
     * <desc/>
     * @param  param  查询参数集
     * @return List<UnitInfoPO>    返回对象集
     * @author Biao.R
     * @createDate 2017/11/8
     */
    @PostMapping(path = "sdkServer/unit/getUnitByParam")
    List<UnitInfoPO> getUnitByParam(@RequestBody Map<String, Object> param);

    /**
     * <desc>
     *      更新单元信息
     * <desc/>
     * @param   unitPO    待更新的PO对象
     * @return  Integer     更新数量
     * @author Biao.R
     * @createDate 2017/11/8
     */
    @PostMapping(path = "sdkServer/unit/update")
    Integer update(@RequestBody UnitInfoPO unitPO);

    /**
     * <desc>
     *      保存单元信息
     * <desc/>
     * @param   unitPO    待保存的PO对象
     * @return  Integer     保存数量
     * @author Biao.R
     * @createDate 2017/11/8
     */
    @PostMapping(path = "sdkServer/unit/save")
    Integer save(@RequestBody UnitInfoPO unitPO);

    /**
     * <desc>
     *      根据单元编号查询单元ID
     * <desc/>
     * @param  params   查询参数集
     * @return  单元ID拼接成的字符串
     * @author Biao.R
     * @createDate 2017/11/14
     */
    @PostMapping(path = "sdkServer/unit/getUnitIdsByParams")
    String getUnitIdsByParams(@RequestBody Map<String, String> params);
}
